﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
   
   <BooleanToVisibilityConverter x:Key="bool_visi" />

   <SolidColorBrush x:Key="_HighlightBorderBrush"
                    Color="#E5C365" />
   
   <SolidColorBrush x:Key="_DialogBacking"
                    Color="DarkGray"
                    Opacity="0.4" />

   <LinearGradientBrush x:Key="_HighlightBackground"
                        StartPoint="0,0"
                        EndPoint="0,1">
      <GradientStop Color="#FFE8A6"
                    Offset=".4" />
      <GradientStop Color="#FFEDBA"
                    Offset=".6" />
      <GradientStop Color="#FFFAEC" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="_DialogBackground"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="#FFA3AEB9"
                    Offset="0" />
      <GradientStop Color="#FF8399A9"
                    Offset="0.375" />
      <GradientStop Color="#FF718597"
                    Offset="0.375" />
      <GradientStop Color="#FF617584"
                    Offset="1" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="_ToolBarBackground"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="White"
                    Offset="0" />
      <GradientStop Color="LightGray"
                    Offset="0.375" />
      <GradientStop Color="#FFA1A5A7"
                    Offset="0.375" />
      <GradientStop Color="Gray"
                    Offset="1" />
   </LinearGradientBrush>

   <LinearGradientBrush x:Key="_TitleBarBackground"
                        EndPoint="0.5,1"
                        StartPoint="0.5,0">
      <GradientStop Color="White"
                    Offset="0" />
      <GradientStop Color="#FFE3E3E3"
                    Offset="0.375" />
      <GradientStop Color="#FFD3D3D3"
                    Offset="0.375" />
      <GradientStop Color="#FFB3B3B3"
                    Offset="1" />
   </LinearGradientBrush>

   <Style TargetType="{x:Type TextBox}">
      <Style.Triggers>
         <Trigger Property="Validation.HasError"
                  Value="true">
            <Setter Property="ToolTip"
                    Value="{Binding RelativeSource={RelativeSource Self}, 
                       Path=(Validation.Errors)[0].ErrorContent}" />
         </Trigger>
      </Style.Triggers>
   </Style>

   <Style TargetType="ButtonBase" x:Key="_ToolBarButton">
      <Setter Property="Background"
              Value="Transparent" />
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="ButtonBase">
               <ControlTemplate.Resources>
                  <Style TargetType="{x:Type Image}">
                     <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}"
                                     Value="False">
                           <Setter Property="Opacity" Value="0.50" />
                        </DataTrigger>
                     </Style.Triggers>
                  </Style>
               </ControlTemplate.Resources>
               <Border BorderThickness="1"
                       BorderBrush="Transparent"
                       x:Name="PART_Border"
                       Background="{TemplateBinding Background}">
                  <ContentPresenter Content="{TemplateBinding Content}"
                                    Margin="1" />
               </Border>
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver"
                           Value="True">
                     <Setter Property="BorderBrush"
                             TargetName="PART_Border"
                             Value="#E5C365" />
                     <Setter Property="Background"
                             TargetName="PART_Border">
                        <Setter.Value>
                           <LinearGradientBrush StartPoint="0,0"
                                                EndPoint="0,1">
                              <GradientStop Color="#FFE8A6"
                                            Offset=".4" />
                              <GradientStop Color="#FFEDBA"
                                            Offset=".6" />
                              <GradientStop Color="#FFFAEC" />
                           </LinearGradientBrush>
                        </Setter.Value>
                     </Setter>
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

   <Style TargetType="ToggleButton"
          x:Key="_ToolBarToggleButton">
      <Setter Property="Background"
              Value="Transparent" />
      <Setter Property="Template">
         <Setter.Value>
            <ControlTemplate TargetType="ToggleButton">
               <ControlTemplate.Resources>
                  <Style TargetType="{x:Type Image}">
                     <Style.Triggers>
                        <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type Button}, AncestorLevel=1}, Path=IsEnabled}"
                                     Value="False">
                           <Setter Property="Opacity"
                                   Value="0.50" />
                        </DataTrigger>
                     </Style.Triggers>
                  </Style>
               </ControlTemplate.Resources>
               <Border BorderThickness="1"
                       BorderBrush="Transparent"
                       x:Name="PART_Border"
                       Background="{TemplateBinding Background}">
                  <ContentPresenter Content="{TemplateBinding Content}"
                                    Margin="1" />
               </Border>
               <ControlTemplate.Triggers>
                  <Trigger Property="IsMouseOver"
                           Value="True">
                     <Setter Property="BorderBrush"
                             TargetName="PART_Border"
                             Value="#E5C365" />
                     <Setter Property="Background"
                             TargetName="PART_Border">
                        <Setter.Value>
                           <LinearGradientBrush StartPoint="0,0"
                                                EndPoint="0,1">
                              <GradientStop Color="#FFE8A6"
                                            Offset=".4" />
                              <GradientStop Color="#FFEDBA"
                                            Offset=".6" />
                              <GradientStop Color="#FFFAEC" />
                           </LinearGradientBrush>
                        </Setter.Value>
                     </Setter>
                  </Trigger>
                  <Trigger Property="IsChecked"
                           Value="True">
                     <Setter Property="BorderBrush"
                             TargetName="PART_Border"
                             Value="#E5C365" />
                     <Setter Property="Background"
                             TargetName="PART_Border">
                        <Setter.Value>
                           <LinearGradientBrush StartPoint="0,0"
                                                EndPoint="0,1">
                              <GradientStop Color="#FFE8A6"
                                            Offset=".4" />
                              <GradientStop Color="#FFEDBA"
                                            Offset=".6" />
                              <GradientStop Color="#FFFAEC" />
                           </LinearGradientBrush>
                        </Setter.Value>
                     </Setter>
                  </Trigger>
               </ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>

</ResourceDictionary>